package com.mmd.manage.service.impl;

import com.mmd.common.entity.MmdImg;
import com.mmd.manage.dao.MmdImgDao;
import com.mmd.manage.service.FileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author cyq
 * @Date 2019/8/24 12:41
 * @Description
 **/
@Service
public class FileServiceImpl implements FileService {
    @Autowired
    MmdImgDao mmdImgDao;

    @Override
    public boolean upload(MmdImg img) {
        int insert = mmdImgDao.insert(img);
        return insert == 1;
    }

    @Override
    public MmdImg getImg(String imgId) {
        return mmdImgDao.selectByPrimaryKey(imgId);
    }
}
